home *** CD-ROM | disk | FTP | other *** search
- Wes Hardaker writes:
- >Has anyone made any patches that will allow rayshade to output a
- >height field rather than a image? (IE, closer points in white,
- >farther in black).
-
- I made a hack to do this. I was going to do random dot stereograms
- with the output. Never got around to the stereograms but my ray2hf
- seemed to kind-o-sort-of work.
-
- I've attached my diffs.
-
- WARNING: this is a hack.
- WARNING: it's also a hand pieced together set of diffs
- --
- Paul Chamberlain | <I do NOT speak for IBM!> | UNIX: tif@austin.ibm.com
- IBM AWS, I/O Dev | 512/838-3759, IBM T/L 678 | IBM-VNET: TIF AT AUSTIN
-
-
- *** src/libshade/Makefile Wed Aug 26 13:26:39 1992
- --- ray2hf/libshade/Makefile Tue Aug 17 14:29:32 1993
- ***************
- *** 25,31 ****
- INCLUDE = -I.. -I$(LIBRAYDIR)
- YFLAGS = -d
-
- ! CFLAGS = $(CCFLAGS) $(URTINC) $(INCLUDE) $(OPTIMIZE)
- SHELL = /bin/sh
-
- LIB = libshade.a
- --- 25,31 ----
- INCLUDE = -I.. -I$(LIBRAYDIR)
- YFLAGS = -d
-
- ! CFLAGS = $(CCFLAGS) $(URTINC) $(INCLUDE) $(OPTIMIZE) -DRAY2HF
- SHELL = /bin/sh
-
- LIB = libshade.a
-
-
-
- *** src/libshade/picture.c Tue Aug 17 11:47:38 1993
- --- ray2hf/libshade/picture.c Tue Aug 17 11:53:01 1993
- ***************
- *** 289,295 ****
- } else
- Options.pictfile = stdout;
-
- ! fprintf(Options.pictfile,"%d %d\n",Screen.xsize, Screen.ysize);
-
- (void)fflush(Options.pictfile);
- }
- --- 289,295 ----
- } else
- Options.pictfile = stdout;
-
- ! fprintf(Options.pictfile,"P5\n%d %d\n255\n",Screen.xsize, Screen.ysize);
-
- (void)fflush(Options.pictfile);
- }
- ***************
- *** 301,309 ****
- register int i;
-
- for (i = 0; i < Screen.xsize; i++) {
- ! (void)fputc((int)CORRECT(buf[i].r), Options.pictfile);
- ! (void)fputc((int)CORRECT(buf[i].g), Options.pictfile);
- ! (void)fputc((int)CORRECT(buf[i].b), Options.pictfile);
- }
- (void)fflush(Options.pictfile);
- }
- --- 301,308 ----
- register int i;
-
- for (i = 0; i < Screen.xsize; i++) {
- ! fprintf(stderr,"alpha=%f\n",buf[i].alpha);
- ! (void)fputc((int)(buf[i].alpha), Options.pictfile);
- }
- (void)fflush(Options.pictfile);
- }
-
-
- *** src/libshade/viewing.c Wed Aug 26 13:26:39 1992
- --- ray2hf/libshade/viewing.c Tue Aug 17 14:22:01 1993
- ***************
- *** 239,245 ****
- --- 239,247 ----
- color->r *= Sampling.filter[u][v];
- color->g *= Sampling.filter[u][v];
- color->b *= Sampling.filter[u][v];
- + #ifndef RAY2HF
- color->alpha *= Sampling.filter[u][v];
- + #endif
- }
-
- void
- ***************
- *** 281,286 ****
- --- 283,289 ----
- dist = FAR_AWAY;
- hitlist.nodes = 0;
- (void)TraceRay(ray, &hitlist, EPSILON, &dist);
- + #ifndef RAY2HF
- ShadeRay(&hitlist, ray, dist, &Screen.background, &ctmp, &fullintens);
- color->r = ctmp.r;
- color->g = ctmp.g;
- ***************
- *** 287,292 ****
- --- 290,299 ----
- color->b = ctmp.b;
- if (hitlist.nodes != 0) {
- color->alpha = 1.;
- + #else
- + if (hitlist.nodes != 0) {
- + color->alpha = dist;
- + #endif
- } else {
- color->alpha = 0.;
- }
-
-
- *** src/rayshade/Makefile Wed Aug 26 13:26:45 1992
- --- ray2hf/rayshade/Makefile Tue Aug 17 14:29:44 1993
- ***************
- *** 32,38 ****
- # If you are running on a Multimax, add -DMULTIMAX -DSHAREDMEM
- #
-
- ! CFLAGS = $(CCFLAGS) $(INCLUDE) $(OPTIMIZE)
-
- #
- # C-Linda flags, if appropriate
- --- 32,38 ----
- # If you are running on a Multimax, add -DMULTIMAX -DSHAREDMEM
- #
-
- ! CFLAGS = $(CCFLAGS) $(INCLUDE) $(OPTIMIZE) -DRAY2HF
-
- #
- # C-Linda flags, if appropriate
-
-
-
- *** src/rayshade/raytrace.c Wed Aug 26 13:26:45 1992
- --- ray2hf/rayshade/raytrace.c Tue Aug 17 14:27:19 1993
- ***************
- *** 262,268 ****
- --- 262,270 ----
- pix->r *= Sampling.filter[x][y];
- pix->g *= Sampling.filter[x][y];
- pix->b *= Sampling.filter[x][y];
- + #ifndef RAY2HF
- pix->alpha *= Sampling.filter[x][y];
- + #endif
- }
-
- sampnum = 0;
- ***************
- *** 287,293 ****
- --- 289,297 ----
- pix->r += ctmp.r*Sampling.filter[x][y];
- pix->g += ctmp.g*Sampling.filter[x][y];
- pix->b += ctmp.b*Sampling.filter[x][y];
- + #ifndef RAY2HF
- pix->alpha += ctmp.alpha*Sampling.filter[x][y];
- + #endif
- }
- if (++sampnum == Sampling.totsamples)
- sampnum = 0;
-
- ----------
- Administrivia: rayshade-users-request@cs.princeton.edu
- Mailing list: rayshade-users@cs.princeton.edu
-
-